import request from '../utils/request';
import Qs from 'qs'
/**
 * Qs.stringify 序列化数据 
 * 
 */
//1.登录
export const dbLogin = query => {
	return request({
		url: '/vuebacker/login.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};
//2.用户列表
export const dbUserLists = (query) => {
	console.log('数据::', query)
	return request({
		url: '/vuebacker/users.html',
		method: 'get',
		params: query
	})
}
//3.改变用户状态
export const dbChangeStatus = query => {
	return request({
		url: '/vuebacker/editstatus.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};

//4.添加用户
export const dbAdduser = query => {
	return request({
		url: '/vuebacker/adduser.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};

//5.删除用户
export const dbDeluser = query => {
	return request({
		url: '/vuebacker/del.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};

//6.编辑用户
export const dbEdituser = query => {
	return request({
		url: '/vuebacker/edituser.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};

//7.搜索用户
export const dbSearchuser = query => {
	return request({
		url: '/vuebacker/searchuser.html',
		method: 'post',
		data: Qs.stringify(query)
	});
};
